package com.itheima.JDK8date;
/*
LocalDateTime的get/set方法
其中month月份需要减一
 */
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.Month;

public class LocalDateDemo4 {
    public static void main(String[] args) {
        LocalDateTime localDateTime = LocalDateTime.of(2020,5,5,5,5,5);
        System.out.println(localDateTime);//2020-09-24T08:51:48.171368500
        int dayOfMonth = localDateTime.getDayOfMonth();
        System.out.println(dayOfMonth);//月第几天
        Month month = localDateTime.getMonth();
        System.out.println(month);//SEPTEMBER枚举八月
        int monthValue = localDateTime.getMonthValue();
        System.out.println(monthValue-1);//真实八月


        System.out.println("--------------------");
        //LocalDateTime与LocalDate和LocalTime之间的转换to
        LocalDate localDate = localDateTime.toLocalDate();
        System.out.println(localDate);


    }
}
